<?php
function diaporama_innerfade_insert_head($flux)
{
	$jsFile = find_in_path('js/jquery.innerfade.js');
	$cssFile = find_in_path('css/diaporama_innerfade.css');
	/* options */
	$diapogenre = 'fade'; /* fade ou slide */
	$diapotransition = '3000'; /* duree de la transition en millisecondes */
	$diapoduree = '6000'; /* duree d'affichage d'une image en millisecondes */
	$diapohasard = 'sequence'; /* sequence ou random */
	$diapohauteur = '220px'; /* hauteur en px, em, etc... */
	$incHead = <<<EOH
	
<!-- head diaporama -->
<script src="{$jsFile}" type="text/javascript"></script>
<link rel="stylesheet" href="{$cssFile}" type="text/css" media="all" />
<script type="text/javascript">  
$(document).ready( 
	function(){ 
		$('#diaporama_innerfade').innerfade({
		animationtype: '{$diapogenre}',
		speed: {$diapotransition}, 
		timeout: {$diapoduree}, 
		type: '{$diapohasard}', 
		containerheight: '{$diapohauteur}' });
	} ); 
</script>
<!-- fin head diaporama -->

EOH;

	return preg_replace('#(</head>)?$#i', $incHead . "\$1\n", $flux, 1);
}
?>
